import request from "../utils/request";

const getUserList = (queryInfo)=>{
    return request.get('/api/admin/users',{params:{current:queryInfo.pageNum,name:queryInfo.name,email:queryInfo.email,phone:queryInfo.phone}})
}

// 禁用和启用用户账号

const setUserState = (userId)=>{
    return request.patch(`/api/admin/users/${userId}/lock`)
    
}

// 添加用户

const addUser = (addForm)=>{
    return request.post('/api/admin/users',addForm)
}

// 获取用户详情

const getUserInfoDeatil = (userId)=>{
    return request.get(`/api/admin/users/${userId}`)
}

// 修改用户信息

const changeUserInfo = (userId,editForm)=>{
    return request.put(`/api/admin/users/${userId}`,editForm)
}
export {
    getUserList,
    setUserState,
    addUser,
    getUserInfoDeatil,
    changeUserInfo
}